package com.train.fibonacci;

import com.train.fibonacci.generate.DynamicRecursiveFibonacciGenerator;
import com.train.fibonacci.generate.FibonacciGenerator;
import com.train.fibonacci.generate.LoopFibonacciGenerator;
import com.train.fibonacci.generate.RecursiveFibonacciGenerator;
import com.train.fibonacci.report.FibonacciReporter;
import com.train.fibonacci.report.ListFibonacciReporter;
import com.train.fibonacci.report.StdoutFibonacciReporter;

public class Main {

	public static void main(String[] args) {
		FibonacciReporter stdoutReporter = new StdoutFibonacciReporter();
		FibonacciGenerator generater = new LoopFibonacciGenerator();
		generater.generate(10, stdoutReporter);
		System.out.println();
		
		generater = new RecursiveFibonacciGenerator();
		generater.generate(10, stdoutReporter);
		System.out.println();
		
		FibonacciReporter listReporter = new ListFibonacciReporter();
		generater  = new DynamicRecursiveFibonacciGenerator();
		generater.generate(10, listReporter);
		for (long num : ((ListFibonacciReporter)listReporter).getSeries()) {
			System.out.print(num + " ");
		}
	}
}
